Skip to content

Dashboard design tokens: one type ramp, a 4px spacing scale, radii and semantic colors - #551

Merged
coderhelm[bot] merged 5 commits into
mainfrom
design-tokens
Dec 6, 2026
Merged

coderhelm[bot] merged 5 commits into
mainfrom
design-tokens

Conversation

@nambok

@nambok nambok commented Dec 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The dashboard's text sizes looked uneven because the root font size was 18px: every Tailwind size rendered on a fraction (13.5, 15.75, 20.25, 27px), spacing on a 4.5px grid, and pages added arbitrary sizes and raw palette colors on top. This puts the dashboard on one design system: a fixed type ramp, a 4px spacing scale, four radii, two elevations and semantic colors, enforced by the UI lint, with the shell and every shared component moved onto it. Pages under src/app move in a follow-up pull request; For you (src/app/foryou/, merged to main meanwhile) moves onto the tokens here and is held to them.

Changes

  • dashboard/src/app/tokens.css: the tokens. Root back to the browser's 16px. Type ramp 13 / 15 / 16 / 18 / 20 / 24 / 32px, each with a fixed line height on the 4px grid, three weights (400, 500, 600). Semantic text styles: text-page-title, text-section-title, text-body, text-caption, text-data, text-numeric, text-display, text-code-inline. Radii 4 / 6 / 8 / 12px. shadow-popover and shadow-dialog. Colors as --ch-* variables named in @theme inline (bg-surface, border-line, text-fg-muted, bg-warn-soft, text-done...), so a light theme later redefines only the variables.
  • dashboard/src/lib/tokens.ts: the same values for code that can't take a class (charts, QR codes, Mermaid).
  • dashboard/scripts/ui-lint.mjs: new errors type-ramp, spacing-scale, raw-hex, token-drift, and a raw-color count that may only go down. Escape hatch: ui-lint-allow <rule>: <reason> on the line, or ui-lint-allow-file for a whole file (other companies' logos, the code highlighting theme). The low-contrast rule knows the token names.
  • Shell and shared components (src/components, src/lib): palette classes replaced by semantic tokens, sizes on the ramp, font-bold to semibold, buttons and fields one height (36px) and radius (6px), floating surfaces on the elevation tokens, chart colors from TOKENS.
  • PageHeader draws the page title style; the first block under a page header sits 24px below it on every page (globals.css).
  • dashboard/DESIGN.md: the guide, the rules for row titles, group headers, rail numbers and button sizes in lists, and the steps to move a page onto the tokens.
  • Labels and group headers are sentence case; the lint fails an uppercase class. Dark ink on a status fill uses text-fg-inverse, sticky bars stay opaque, and hover states never land on their base token.
  • Inline code draws at 13px instead of 0.9em of its line; bold text in prose is semibold.
  • e2e/design-tokens.spec.ts: on the shell, Inbox, Members and roles and a run's page, at 1440 and 375 wide, every rendered text is on the ramp in one of three weights, the page title is 24/32 semibold with 24px under its header, and the shell uses only the spacing scale and the radii.

Verification

  • npm run lint, npm run typecheck, npm run build, the docs build, the text guards, and the full Playwright suite against the static build (2,276 passed, 29 skipped).
  • The new spec fails on the build from main (15.75px and 13.5px text in the shell) and passes on this branch.
  • Rendered audit across 40 pages at 1440: 15 font sizes, 23 size and line height pairs and 4 weights before.

…d semantic colors

The root font size was 18px, so every Tailwind size rendered on a fraction
(13.5, 15.75, 20.25, 27px) and spacing on a 4.5px grid; pages added their
own arbitrary sizes and raw palette colors on top. The root is back to the
browser's 16px and src/app/tokens.css defines the system:

- a seven-step ramp (13, 15, 16, 18, 20, 24, 32px), each with a fixed line
  height on the 4px grid, three weights, and semantic text styles
  (text-page-title, text-section-title, text-body, text-caption, text-data,
  text-numeric, text-display);
- radii (4, 6, 8, 12px), two elevations for floating surfaces;
- semantic colors for surfaces, lines, text and status (good, warn, bad,
  info, severe, done, accent) as --ch-* variables named in @theme, ready for
  a light theme; src/lib/tokens.ts mirrors them for charts and QR codes.

The UI lint fails an arbitrary font size, an off-ramp weight, an arbitrary
or off-scale padding, margin or gap, a raw hex color outside the token files,
and a tokens.ts value that drifts from tokens.css; palette classes are
counted against a baseline that only goes down. A rare real case is allowed
with a ui-lint-allow comment that says why.

The shell and every shared component move onto the tokens; buttons and
fields share one height and radius; PageHeader draws the one title style and
the first block under it sits 24px below on every page. Pages under src/app
move in their own change (TOKENS_LATER in the lint). DESIGN.md is the guide,
and e2e/design-tokens.spec.ts checks what renders on the shell and three
pages at 1440 and 375 wide.
…e page column

Section and settings tabs keep the 44px touch height below md: now that the
root is 16px. The combobox trigger matches the 36px field height. The
settings column takes the one page width, so its left edge lines up with
every other page. The lint and the class rewrite read data-attribute
variants and the trailing important mark. Specs that matched palette class
names match the semantic ones; the phone menu test closes the full-screen
sheet with its Close button.
…kens

Inline code draws at the caption size instead of 0.9em of its line, so it
never lands between ramp steps; bold text in prose is semibold. The token
rules cover src/app/foryou/ from the start, and DESIGN.md spells out row
titles, group headers, rail numbers and button sizes in lists.
@nambok nambok added the ch-review CoderHelm reviews this pull request label Dec 6, 2026
coderhelm[bot]

This comment was marked as outdated.

# Conflicts:
#	dashboard/src/components/command-palette.tsx
coderhelm[bot]

This comment was marked as outdated.

@coderhelm
coderhelm Bot dismissed their stale review December 6, 2026 05:05

Superseded by CoderHelm's latest review

…sentence case

From the review: dark ink on a status fill (a check on green, a badge
count on red) maps to fg-inverse instead of the status text color; a
mostly opaque status fill used as a dot or a moving bar stays a solid mark;
sticky bars and headers keep their opaque background; a hover that landed
on the same token as its base moves one step (text-accent to
accent-strong, the sign-in button from accent-emphasis to accent-solid).
The filled accent button uses accent-emphasis, deep enough for white text.

Uppercase overlines become sentence-case labels, headings become section
titles, and the lint fails an uppercase class. The spacing rule checks
gap-x and gap-y, and token-drift points at the right line.

@coderhelm coderhelm Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved 35ed744 (merged)

@coderhelm
coderhelm Bot dismissed their stale review December 6, 2026 05:44

Superseded by CoderHelm's latest review

@coderhelm

coderhelm Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

💚 Post-merge health check passed: the deploy of b358f2a completed and stayed green for the full 15-minute watch window (no new failures vs. the pre-merge baseline).
Auto-merge

  • ✅ CoderHelm approved
  • ✅ CI green
    The rest is in the pull request description.

@coderhelm
coderhelm Bot merged commit b358f2a into main Dec 6, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ch-review CoderHelm reviews this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant